home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / PICKUP.C < prev    next >
C/C++ Source or Header  |  1993-03-16  |  17KB  |  649 lines

  1. /*    SCCS Id: @(#)pickup.c    3.0    88/07/12
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. /*
  6.  *    Contains code for picking objects up, and container use.
  7.  */
  8.  
  9. #include    "hack.h"
  10. STATIC_PTR int FDECL(in_container,(struct obj *));
  11. STATIC_PTR int FDECL(ck_container,(struct obj *));
  12. STATIC_PTR int FDECL(ck_bag,(struct obj *));
  13. STATIC_PTR int FDECL(out_container,(struct obj *));
  14. void FDECL(explode_bag,(struct obj *));
  15.  
  16. #define DELTA_CWT(cont) ((cont)->cursed?(obj->owt*2):(obj->owt/((cont)->blessed?4:2)) + 1)
  17.  
  18. #ifdef OVL0
  19.  
  20. static const char nearloadmsg[] = "have a little trouble lifting";
  21.  
  22. void
  23. pickup(all)
  24. int all;
  25. {
  26.     register struct gold *gold = g_at(u.ux, u.uy);
  27.     register struct obj *obj, *obj2;
  28.     register int wt;
  29.     char buf[BUFSZ];
  30.     register char *ip;
  31.     register char sym;
  32.     register int oletct = 0, iletct = 0;
  33.     boolean all_of_a_type = FALSE, selective = FALSE;
  34.     char olets[20], ilets[20];
  35.     struct obj dummygold;
  36.  
  37.     dummygold.ox = u.ux;
  38.     dummygold.oy = u.uy;
  39.     dummygold.olet = GOLD_SYM;
  40.     dummygold.nobj = fobj;
  41.     dummygold.nexthere = level.objects[u.ux][u.uy];
  42.     dummygold.cobj = 0;
  43.  
  44.     if(Levitation) {
  45.         if ((multi && !flags.run) || (all && !flags.pickup))
  46.             read_engr_at(u.ux,u.uy);
  47.         return;
  48.     }
  49.     /* multi && !flags.run means they are in the middle of some other
  50.      * action, or possibly paralyzed, sleeping, etc.... and they just
  51.      * teleported onto the object.  They shouldn't pick it up.
  52.      */
  53.     if ((multi && !flags.run) || (all && !flags.pickup)) {
  54.         int ct = 0;
  55.  
  56.         for (obj = level.objects[u.ux][u.uy]; obj; obj = obj->nexthere)
  57.             if(!obj->cobj && obj != uchain)
  58.                 ct++;
  59.  
  60.         /* Stop on a zorkmid */
  61.         if (gold) ct++;
  62.  
  63.         /* If there are objects here, take a look.
  64.          */
  65.         if (ct) {
  66.             if (flags.run)
  67.                 nomul(0);
  68.             nscr();
  69.             if (ct < 5)
  70.                 (void) dolook();
  71.             else {
  72.                 read_engr_at(u.ux,u.uy);
  73.                 pline("There are several objects here.");
  74.             }
  75.         } else read_engr_at(u.ux,u.uy);
  76.         return;
  77.     }
  78.  
  79.     /* check for more than one object */
  80.     if(!all) {
  81.         register int ct = 0;
  82.  
  83.         if (gold) ct++;
  84.         for(obj = level.objects[u.ux][u.uy]; obj; obj = obj->nexthere)
  85.             if(!obj->cobj) ct++;
  86.         if(ct < 2)
  87.             all++;
  88.         else
  89.             pline("There are several objects here.");
  90.     }
  91.  
  92.     /* added by GAN 10/24/86 to allow selective picking up */
  93.     if(!all)  {
  94.         register struct obj *otmp = level.objects[u.ux][u.uy];
  95.  
  96.         ilets[iletct] = 0;
  97.         if(gold) {
  98.             ilets[iletct++] = GOLD_SYM;
  99.             ilets[iletct] = 0;
  100.         }
  101.         while(otmp) {
  102.             if(!index(ilets, otmp->olet) && !otmp->cobj) {
  103.                 ilets[iletct++] = otmp->olet;
  104.                 ilets[iletct] = 0;
  105.             }
  106.             otmp = otmp->nexthere;
  107.         }
  108.         if(iletct == 1)
  109.             Strcpy(buf,ilets);
  110.         else  {
  111.             ilets[iletct++] = ' ';
  112.             ilets[iletct++] = 'a';
  113.             ilets[iletct++] = 'A';
  114.             ilets[iletct] = 0;
  115.  
  116.             pline("What kinds of thing do you want to pick up? [%s] ", ilets);
  117.             getlin(buf);
  118.             if(buf[0] == '\033') {
  119.                 clrlin();
  120.                 return;
  121.             }
  122.             else if(!buf[0]) selective = TRUE;
  123.         }
  124.         ip = buf;
  125.         olets[0] = 0;
  126.         while(sym = *ip++){
  127.             /* new A function (selective all) added by
  128.              * GAN 01/09/87
  129.              */
  130.             if(sym == ' ') continue;
  131.             if(sym == 'A') selective = TRUE;
  132.             else if(sym == 'a') all_of_a_type = TRUE;
  133.             else if(index(ilets, sym)){
  134.                 if(!index(olets, sym)){
  135.                     olets[oletct++] = sym;
  136.                     olets[oletct] = 0;
  137.                 }
  138.             }
  139.             else pline("There are no %c's here.", sym);
  140.         }
  141.     }
  142.     if(all_of_a_type && !olets[0]) all = TRUE;
  143.  
  144.     for(obj = (gold ? &dummygold : level.objects[u.ux][u.uy]); obj;
  145.             obj = obj2) {
  146.         obj2 = obj->nexthere;   /* perhaps obj will be picked up */
  147.         if(!obj->cobj) {
  148.         if(flags.run) nomul(0);
  149.  
  150.         if(!all)  {
  151.             char c;
  152.  
  153.             if(!selective && !index(olets,obj->olet)) continue;
  154.  
  155.             if (!all_of_a_type) {
  156.                 if (obj == &dummygold)
  157.                     pline("Pick up %ld gold piece%s? ",
  158.                         gold->amount, plur(gold->amount));
  159.                 else pline("Pick up %s? ", doname(obj));
  160.                 if((c = ynaq()) == 'q') return;
  161.                 if(c == 'n') continue;
  162.                 if(c == 'a') {
  163.                     all_of_a_type = TRUE;
  164.                     if (selective) {
  165.                         selective = FALSE;
  166.                         olets[0] = obj->olet;
  167.                         olets[1] = 0;
  168.                         /* oletct = 1; */
  169.                     }
  170.                 }
  171.             }
  172.         }
  173.  
  174.         if(obj == &dummygold) {
  175.             int iw = inv_weight();
  176.             long gold_capacity;
  177.  
  178. #ifndef lint /* long/int conversion */
  179.             iw -= (int)((u.ugold + 500)/1000);
  180. #endif
  181.             gold_capacity = ((-iw) * 1000L) - 500 + 999 - u.ugold;
  182.             if (gold_capacity <= 0L) {
  183.      pline("There %s %ld gold piece%s here, but you cannot carry any more.",
  184.                 (gold->amount == 1) ? "is" : "are",
  185.                 gold->amount, plur(gold->amount));
  186.             continue;
  187.             }
  188.             if (gold_capacity >= gold->amount) {
  189.             u.ugold += gold->amount;
  190.             if (inv_weight() > -5)
  191.                 You(nearloadmsg);
  192.             pline("%ld gold piece%s.",
  193.                 gold->amount, plur(gold->amount));
  194.             freegold(gold);
  195.             if(Invisible) newsym(u.ux,u.uy);
  196.             } else {
  197.         You("can only carry %s of the %ld gold pieces lying here.",
  198.                 gold_capacity == 1L ? "one" : "some", gold->amount);
  199.             You(nearloadmsg);
  200.             pline("%ld gold piece%s.",
  201.                  gold_capacity, plur(gold_capacity));
  202.             u.ugold += gold_capacity;
  203.             gold->amount -= gold_capacity;
  204.             }
  205.             flags.botl = 1;
  206.             if(flags.run) nomul(0);
  207.             continue;
  208.         }
  209.  
  210.         if((obj->otyp == CORPSE && obj->corpsenm == PM_COCKATRICE) &&
  211.            !uarmg
  212. #ifdef POLYSELF
  213.             && !resists_ston(uasmon)
  214. #endif
  215.                         ) {
  216.             pline("Touching the dead cockatrice is a fatal mistake.");
  217.             You("turn to stone.");
  218.             You("die...");
  219.             killer_format = KILLED_BY_AN;
  220.             killer = "cockatrice corpse";
  221.             done(STONING);
  222.         }
  223.  
  224.         if(obj->otyp == SCR_SCARE_MONSTER){
  225.           if(obj->blessed) obj->blessed = 0;
  226.           else if(!obj->spe && !obj->cursed) obj->spe = 1;
  227.           else {
  228.             pline("The scroll%s turn%s to dust as you pick %s up.",
  229.                 plur((long)obj->quan), (obj->quan==1) ? "s":"",
  230.                 (obj->quan==1) ? "it" : "them");
  231.             if(!(objects[SCR_SCARE_MONSTER].oc_name_known) &&
  232.                !(objects[SCR_SCARE_MONSTER].oc_uname))
  233.                 docall(obj);
  234.             useupf(obj);
  235.             continue;
  236.           }
  237.         }
  238.  
  239.         /* do not pick up uchain */
  240.         if(obj == uchain)
  241.             continue;
  242.  
  243.         wt = inv_weight() + (int)obj->owt;
  244.         if (obj->otyp == LOADSTONE)
  245.             goto lift_some; /* pick it up even if too heavy */
  246. #ifdef POLYSELF
  247.         if (obj->otyp == BOULDER && throws_rocks(uasmon)) {
  248.             wt = inv_weight();
  249.             goto lift_some;
  250.         }
  251. #endif
  252.         if(wt > 0) {
  253.             if(obj->quan > 1) {
  254.                 /* see how many we can lift */
  255.                 unsigned savequan = obj->quan;
  256.                 int iw = inv_weight();
  257.                 unsigned qq;
  258.                 for(qq = 1; qq < savequan; qq++){
  259.                     obj->quan = qq;
  260.                     if(iw + weight(obj) > 0)
  261.                         break;
  262.                 }
  263.                 obj->quan = savequan;
  264.                 qq--;
  265.                 /* we can carry qq of them */
  266.                 if(qq) {
  267.                     register struct obj *obj3;
  268.  
  269.                 You("can only carry %s of the %s lying here.",
  270.                         (qq == 1) ? "one" : "some",
  271.                         doname(obj));
  272.                     obj3 = splitobj(obj, (int)qq);
  273.                     if(obj3->otyp == SCR_SCARE_MONSTER)
  274.                         if(obj3->spe) obj->spe = 0;
  275.                     goto lift_some;
  276.                 }
  277.             }
  278.             pline("There %s %s here, but %s.",
  279.                 (obj->quan == 1) ? "is" : "are",
  280.                 doname(obj),
  281.                 !invent ? "it is too heavy for you to lift"
  282.                     : "you cannot carry any more");
  283.                 if(obj->otyp == SCR_SCARE_MONSTER)
  284.                     if(obj->spe) obj->spe = 0;
  285.             break;
  286.         }
  287.     lift_some:
  288.         if(inv_cnt() >= 52) {
  289.             Your("knapsack cannot accommodate any more items.");
  290.             if(obj->otyp == SCR_SCARE_MONSTER)
  291.                 if(obj->spe) obj->spe = 0;
  292.             break;
  293.         }
  294.         { unsigned pickquan = obj->quan;
  295.           unsigned mergquan;
  296.  
  297.           obj = pick_obj(obj);
  298.           if(wt > -5) You(nearloadmsg);
  299.           if(!Blind) obj->dknown = 1;
  300.           mergquan = obj->quan;
  301.           obj->quan = pickquan; /* to fool prinv() */
  302.           if(uwep && uwep == obj) mrg_to_wielded = TRUE;
  303.           prinv(obj);
  304.           mrg_to_wielded = FALSE;
  305.           obj->quan = mergquan;
  306.         }
  307.         }
  308.     }
  309. }
  310.  
  311. struct obj *
  312. pick_obj(otmp)
  313. register struct obj *otmp;
  314. {
  315.     if (otmp != uball)         /* don't charge for this - kd, 1/17/90 */
  316.         addtobill(otmp, TRUE);       /* sets obj->unpaid if necessary */
  317.     freeobj(otmp);
  318.     if(Invisible) newsym(u.ux,u.uy);
  319.     return(addinv(otmp));    /* might merge it with other objects */
  320. }
  321.  
  322. #endif /* OVL1 */
  323. #ifdef OVLB
  324.  
  325. int
  326. doloot() {    /* loot a container on the floor. */
  327.  
  328.     register struct obj *cobj, *nobj;
  329.     register int c;
  330.  
  331.     if (Levitation) {
  332.         You("cannot reach the floor.");
  333.         return(0);
  334.     }
  335.     for(cobj = level.objects[u.ux][u.uy]; cobj; cobj = nobj) {
  336.             nobj = cobj->nexthere;
  337.  
  338.         if(Is_container(cobj)) {
  339.  
  340.             pline("There is %s here, loot it? ", doname(cobj));
  341.             c = ynq();
  342.             if(c == 'q') return 0;
  343.             if(c == 'n') continue;
  344.  
  345.             if(cobj->olocked) {
  346.  
  347.             pline("Hmmm, it seems to be locked.");
  348.             continue;
  349.             }
  350.             if(cobj->otyp == BAG_OF_TRICKS) {
  351.  
  352.             You("carefully open the bag...");
  353.             pline("It develops a huge set of teeth and bites you!");
  354.             losehp(rnd(10), "carnivorous bag", KILLED_BY_AN);
  355.             makeknown(BAG_OF_TRICKS);
  356.             continue;
  357.             }
  358.  
  359.             You("carefully open the %s...", xname(cobj));
  360.             if(cobj->otrapped && chest_trap(cobj, FINGER)) /* don't use obj if obj dies */
  361.               continue;
  362.             if(multi < 0) return 0; /* a paralysis trap */
  363.  
  364.             use_container(cobj, 0);
  365.         }
  366.     }
  367.     return 0;
  368. }
  369.  
  370. static
  371. struct obj NEARDATA *current_container;    /* a local variable of use_container, to be
  372.                 used by its local procedures in/ck_container */
  373. #define Icebox (current_container->otyp == ICE_BOX)
  374. int baggone;    /* used in askchain so bag isn't used after explosion */
  375.  
  376. #endif /* OVLB */
  377. #ifdef OVL1
  378.  
  379. void
  380. inc_cwt(cobj, obj)
  381. register struct obj *cobj, *obj;
  382. {
  383.     if (cobj->otyp == BAG_OF_HOLDING)
  384.         cobj->owt += DELTA_CWT(cobj);
  385.     else    cobj->owt += obj->owt;
  386. }
  387.  
  388. #endif /* OVL1 */
  389. #ifdef OVLB
  390.  
  391. STATIC_PTR int
  392. in_container(obj)
  393. register struct obj *obj;
  394. {
  395.     char buf[BUFSZ];
  396.  
  397.     if(obj == uball || obj == uchain) {
  398.         You("must be kidding.");
  399.         return(0);
  400.     }
  401.     if(obj == current_container) {
  402.         pline("That would be an interesting topological exercise.");
  403.         return(0);
  404.     }
  405.     if(obj->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) {
  406.         You("cannot %s something you are wearing.",
  407.             Icebox ? "refrigerate" : "stash");
  408.         return(0);
  409.     }
  410.     if((obj->otyp == LOADSTONE) && obj->cursed) {
  411.         obj->bknown = 1;
  412.         pline("The stone%s won't leave your person.",
  413.             plur((long)obj->quan));
  414.         return(0);
  415.     }
  416.     /* Prohibit Amulets in containers; if you allow it, monsters can't
  417.      * steal them.  It also becomes a pain to check to see if someone
  418.      * has the Amulet.
  419.      */
  420.     if(obj->otyp == AMULET_OF_YENDOR && !obj->spe) {
  421.         pline("The Amulet of Yendor cannot be confined in such trappings.");
  422.         return(0);
  423.     }
  424.     /* no nested containers - they do not save/restore properly. */
  425.     /* magic bag -> magic bag will self destruct later on. */
  426.     if(Is_container(obj) && Is_container(current_container) &&
  427.         (!Is_mbag(obj) || !Is_mbag(current_container))) {
  428.         pline("The %s won't go in.", xname(obj));
  429.         return(1);    /* be careful! */
  430.     }
  431.     if(obj == uwep) {
  432.         if(welded(obj)) {
  433.             weldmsg(obj, FALSE);
  434.             return(0);
  435.         }
  436.         setuwep((struct obj *) 0);
  437.         if (uwep) return(0); /* unwielded, died, rewielded */
  438.     }
  439. #ifdef WALKIES
  440.     if(obj->otyp == LEASH && obj->leashmon != 0) {
  441.         pline("The %s is attached to your pet.", xname(obj));
  442.         return(0);
  443.     }
  444. #endif
  445.     inc_cwt(current_container, obj);
  446.     freeinv(obj);
  447.  
  448.     obj->cobj = current_container;
  449.     obj->nobj = fcobj;
  450.     fcobj = obj;
  451.     Strcpy(buf, xname(obj->cobj));
  452.     You("put %s into the %s.", doname(obj), buf);
  453.  
  454.     if(Icebox) obj->age = monstermoves - obj->age; /* actual age */
  455.  
  456.     else if(Is_mbag(obj->cobj) &&
  457.         (Is_mbag(obj) ||
  458.          (obj->otyp == WAN_CANCELLATION && (obj->spe > 0)) )) {
  459.         explode_bag(obj);
  460.         You("are blasted by a magical explosion!");
  461.         losehp(d(6,6),"magical explosion", KILLED_BY_AN);
  462.         baggone = 1;
  463.     }
  464.     return(1);
  465. }
  466.  
  467. STATIC_PTR int
  468. ck_container(obj)
  469. register struct obj *obj;
  470. {
  471.     return(obj->cobj == current_container);
  472. }
  473.  
  474. /* ck_bag() needs a formal argument to make the overlay/prototype mechanism
  475.  * work right */
  476. /*ARGSUSED*/
  477. STATIC_PTR int
  478. ck_bag(obj)
  479. struct obj *obj;
  480. {
  481.     return(!baggone);
  482. }
  483.  
  484. STATIC_PTR int
  485. out_container(obj)
  486. register struct obj *obj;
  487. {
  488.     register struct obj *otmp, *ootmp;
  489.     register boolean near_capacity = (inv_weight() > -5);
  490.  
  491.     if(inv_cnt() >= 52) {
  492.         pline("You have no room to hold anything else.");
  493.         return(0);
  494.     }
  495.     if(obj->otyp != LOADSTONE && inv_weight() + (int)obj->owt -
  496.        (carried(current_container) ?
  497.         (current_container->otyp == BAG_OF_HOLDING ?
  498.             (int)DELTA_CWT(current_container) : (int)obj->owt) : 0) > 0) {
  499.         char buf[BUFSZ];
  500.  
  501.         Strcpy(buf, doname(obj));
  502.         pline("There %s %s in the %s, but %s.",
  503.             obj->quan==1 ? "is" : "are",
  504.             buf, xname(current_container),
  505.             invent ? "you cannot carry any more"
  506.             : "it is too heavy for you to carry");
  507.         /* "too heavy for you to lift" is not right if you're carrying
  508.            the container... */
  509.         return(0);
  510.     }
  511.     if(obj == fcobj) fcobj = fcobj->nobj;
  512.     else {
  513.         for(otmp = fcobj; otmp->nobj != obj; otmp = otmp->nobj)
  514.             if(!otmp->nobj) panic("out_container");
  515.         otmp->nobj = obj->nobj;
  516.     }
  517.     dec_cwt(current_container, obj);
  518.     obj->cobj = (struct obj *) 0;
  519.  
  520.     if (Icebox) obj->age = monstermoves - obj->age;
  521.     /* simulated point of time */
  522.  
  523.     ootmp = addinv(obj);
  524.     if (near_capacity) You("have a little trouble removing");
  525.     prinv(ootmp);
  526.     return 0;
  527. }
  528.  
  529. /* for getobj: 0: allow cnt; #: allow all types; %: expect food */
  530. static const char NEARDATA frozen_food[] = { '0', '#', FOOD_SYM, 0 };
  531.  
  532. void
  533. use_container(obj, held)
  534. register struct obj *obj;
  535. register int held;
  536. {
  537.     register int cnt = 0;
  538.     register struct obj *otmp;
  539.     register struct obj *backobj;
  540.  
  541.     current_container = obj;    /* for use by in/out_container */
  542.     if(current_container->olocked) {
  543.         pline("The %s seems to be locked.", xname(current_container));
  544.         return;
  545.     }
  546.     for(otmp = fcobj, backobj = (struct obj *) 0; otmp;
  547.         backobj = otmp, otmp = otmp->nobj)
  548.         if(otmp->cobj == obj)
  549.             if(Is_mbag(obj) && obj->cursed && !rn2(13)) {
  550.             if (otmp->known)
  551.                 pline("The %s to have vanished!",
  552.                             aobjnam(otmp,"seem"));
  553.             else You("%s %s disappear.",
  554.                 Blind ? "notice" : "see",
  555.                 doname(otmp));
  556.             if(!backobj) {
  557.                 fcobj = otmp->nobj;
  558.                 dec_cwt(current_container, otmp);
  559.                 obfree(otmp, (struct obj *) 0);
  560.                 otmp = fcobj;
  561.             } else {
  562.                 backobj->nobj = otmp->nobj;
  563.                 dec_cwt(current_container, otmp);
  564.                 obfree(otmp, (struct obj *) 0);
  565.                 otmp = backobj->nobj;
  566.             }
  567.             if (!otmp) break;
  568.             if(otmp->cobj == obj) cnt++;
  569.             } else cnt++;
  570.     if(!cnt)
  571.         pline("%s %s is empty.", (held) ? "Your" : "The", xname(obj));
  572.     else if (inv_cnt() < 52) {
  573.         pline("Do you want to take something out of the %s? ",
  574.           xname(obj));
  575.         if(yn() != 'n')
  576.         if(askchain(fcobj, FALSE, NULL, 0, out_container, ck_container, 0, "nodot"))
  577.             return;
  578.     }
  579.     if(!invent) return;
  580.     pline("Do you wish to put something in? ");
  581.     if(yn() != 'y') return;
  582.     if (Icebox && current_container->dknown) {
  583.         otmp = getobj(frozen_food, "put in");
  584.         if(!otmp || !in_container(otmp))
  585.             flags.move = multi = 0;
  586.     } else {
  587.         baggone = 0; /* might be set by in_container */
  588.         if(askchain(invent, TRUE, NULL, 0, in_container, ck_bag, 0, "nodot"))
  589.           return;
  590.     }
  591.     return;
  592. }
  593.  
  594. void
  595. delete_contents(obj)
  596. register struct obj *obj;
  597. {
  598.     register struct obj *otmp, *notmp;
  599.  
  600.     while (fcobj && fcobj->cobj == obj) {
  601.         otmp = fcobj;
  602.         fcobj = fcobj->nobj;
  603.         obfree(otmp,(struct obj *)0);
  604.     }
  605.     if (fcobj) {
  606.         otmp = fcobj;
  607.         while(otmp->nobj)
  608.             if (otmp->nobj->cobj == obj) {
  609.                 notmp = otmp->nobj;
  610.                 otmp->nobj = notmp->nobj;
  611.                 obfree(notmp,(struct obj *)0);
  612.             } else
  613.                 otmp = otmp->nobj;
  614.     }
  615. }
  616.  
  617. void
  618. explode_bag(obj)
  619. struct obj *obj;
  620. {
  621.     struct obj *otmp, *cobj;
  622.  
  623.     cobj = obj->cobj;
  624.     delete_contents(cobj);
  625.  
  626.     for (otmp = invent; otmp; otmp = otmp->nobj)
  627.         if (otmp == cobj) break;
  628.  
  629.     if (otmp) {
  630.         You("see your %s blow apart!", xname(otmp));
  631.         useup(otmp);
  632.         /*return(0);*/
  633.     } else    panic("explode_bag: bag not in invent.");
  634. }
  635.  
  636. void
  637. dec_cwt(cobj, obj)
  638. register struct obj *cobj, *obj;
  639. {
  640.     if (cobj->otyp == BAG_OF_HOLDING)
  641.         cobj->owt -= DELTA_CWT(cobj);
  642.     else    cobj->owt -= obj->owt;
  643.  
  644.     if(cobj->owt < objects[cobj->otyp].oc_weight)
  645.         cobj->owt = objects[cobj->otyp].oc_weight;
  646. }
  647.  
  648. #endif /* OVLB */
  649.